﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
//using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
//using System.Xml.Linq;

public partial class MasterPage2 : System.Web.UI.MasterPage
{
    long permiso = 0, restricted=0;
    public bool neworder = true;
    public long RMP2 = 0, PMP2 = 0;
    public DataSet dsMenu = new DataSet();
    public int perfil = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
        rUser user = (rUser)(Session["userid"]);
        RE_GenericBean permi;
        if (user != null)
        {
            permi = new RE_GenericBean();
            permi = Utility.getPermisobyRuser(user, 19);
            PMP2 = permi.int64C1;
            RMP2 = permi.int64C2;
            restricted = long.Parse(user.getRestricted().ToString());
            permiso = long.Parse(user.getPermisoUser().ToString());

            perfil = int.Parse(user.getPerfilId());
            try
            {
                string rxml = null;
                com.bpophotos.www.Service service = new com.bpophotos.www.Service();
                rxml = service.getMenus(1, 2);

                if (!rxml.Equals("") || rxml != null)
                {
                    dsMenu = Utility.getPermitMenu(rxml);
                }
            }
            catch (Exception ee)
            {
                Utility.writeError(ee.Message);
            }
        }
        else {
            Response.Redirect("../Default.aspx");
        }
        if ((restricted & 65536) == 65536) { neworder = false; }
      
    }
   
}
